<!DOCTYPE html>
<html>
{% include 'head.html' %}
<body>
	{% include 'navbar.html' %}
	{% if person %}
		{% include 'header.html' %}
		{% url movies.views.view_person urlname=person.UrlName as person_url %}
		{% if request.session.admin %}
			<ul class="nav nav-tabs">
				<li class="active">
					<a href="{{person_url}}">View</a>
				</li>
				<li><a href="{{person_url}}?edit=1">Edit</a></li>
			</ul>
		{% endif %}
		<table class="table table-striped table-bordered">
			{% if directed_movies|length > 0 %}
				<tr><th class="span5">Director ({{directed_movies|length}} titles)</th><th class="span1"></th><th class="span2"></th></tr>
				{% for movie, bool in directed_movies %}
					<tr>
						{% url movies.views.view_movie urltitle=movie.UrlTitle as movie_url %}
						<td><a href="{{movie_url}}">{{movie.Title}}</a></td>
						<td style="text-align: center">{{movie.Year}}</td>
						<td style="text-align: center">
							{% if bool %}
								<a class="btn btn-small btn-success" href="{{movie_url}}">Options</a>
							{% else %}
								<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1&seen=1">Seen</a>
								&nbsp&nbsp&nbsp
								<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1">Want</a>
							{% endif %}
						</td>
					</tr>
				{% endfor %}
			{% endif %}
			{% if written_movies|length > 0 %}
				<tr><th class="span5">Writer ({{written_movies|length}} titles)</th><th class="span1"></th><th class="span2"></th></tr>
				{% for movie, bool in written_movies %}
					<tr>
						{% url movies.views.view_movie urltitle=movie.UrlTitle as movie_url %}
						<td><a href="{{movie_url}}">{{movie.Title}}</a></td>
						<td style="text-align: center">{{movie.Year}}</td>
						<td style="text-align: center">
							{% if bool %}
								<a class="btn btn-small btn-success" href="{{movie_url}}">Options</a>
							{% else %}
								<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1&seen=1">Seen</a>
								&nbsp&nbsp&nbsp
								<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1">Want</a>
							{% endif %}
						</td>
					</tr>
				{% endfor %}
			{% endif %}
			{% if acted_movies|length > 0 %}
				<tr><th class="span5">Actor ({{acted_movies|length}} titles)</th><th class="span1"></th><th class="span2"></th></tr>
				{% for movie, bool in acted_movies %}
					<tr>
						{% url movies.views.view_movie urltitle=movie.UrlTitle as movie_url %}
						<td><a href="{{movie_url}}">{{movie.Title}}</a></td>
						<td style="text-align: center">{{movie.Year}}</td>
						<td style="text-align: center">
							{% if bool %}
								<a class="btn btn-small btn-success" href="{{movie_url}}">Options</a>
							{% else %}
								<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1&seen=1">Seen</a>
								&nbsp&nbsp&nbsp
								<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1">Want</a>
							{% endif %}
						</td>
					</tr>
				{% endfor %}
			{% endif %}
		</table>
		<div class="row">
			<div class="span4">
				<a href="{{person_url}}?suggestion=1">Suggestion/Comment/Correction</a>
			</div>
		</div>
	{% else %}
		<div class="page-header">
			<h1>invalid person</h1>
		</div>
	{% endif %}
	{% include 'footer.html' %}
</body>
</html>